<?php


namespace app\shop\service\user;


use app\shop\model\user\AdminRoleModel;
use app\shop\service\BaseService;

class AdminRoleService extends BaseService
{
    private static $instance;

    public function __construct()
    {
    }

    public static function getInstance()
    {
        if (!self::$instance) {
            self::$instance = new AdminRoleModel();
        }
        return self::$instance;
    }

    public static function getOneLineByName($name, $value, $field = '*')
    {
        return self::getInstance()::field($field)->where($name, $value)->find();
    }

    public static function getValueByName($name, $value, $field)
    {
        return self::getInstance()::where($name, $value)->value($field);
    }
}